import request from '@/plugins/request.js'
/* 
请求封装说明
表单格式提交 post请求: .post();  get请求: .get();
对象格式提交 post请求: .JSON_Post();
blob 用于导出 post.JSON格式：.blob_post_json(); post表单： .blob_post() ;get表单： .blob_get();
delete 删除
export function delFourPlusOne(param = {}) { // 删除(主键)
  return request.delete('/investment/four-plus-one/delete/'+ param)
}
添加接口加载动画 {loading:true}
案例 export function api(param = {}, resParams) { //api
  return request.post(url, param, resParams,{loading:true})
} 
*/

var commonUrl = ''
var uploadUrl = ''

switch (process.env.NODE_ENV) {
  case "development": //生产环境
    commonUrl = ''
    // commonUrl = '' //天益本地
    uploadUrl = 'https://wxtest.tofocus.cn/file/v3/image/upload'
    break;
  case "test": //测试环境
    commonUrl = ''
    break;
  default:
    commonUrl = ''
    uploadUrl = 'https://weixin.sm96596.com/fslm/file/v3/image/upload'
}



export function registerGift(param = {}, resParams) {//领取注册礼包
  return request.post(`${commonUrl}/h5/auth/registerGift`, param, resParams, )
}
export function checkSubscribe_wx(param = {}, resParams) { //检查是否关注公众号
  return request.get(`${commonUrl}/h5/auth/checkSubscribe`, param, resParams, )
}







// 上传接口



export function getToken(param = {}, resParams) {
  return request.post(`${commonUrl}/v1/app/member/info/get/token`, param, resParams, )
}
export function upload(param = {}, resParams) {
  return request.blob_post(`${uploadUrl}`, param, resParams, )
}

//核销员
export function query_veri(param = {}, resParams) { //列表
  return request.post(`${commonUrl}/v1/app/vendor/veri/query`, param, resParams, )
}
export function stop_veri(param = {}, resParams) { //停用
  return request.post(`${commonUrl}/v1/app/vendor/veri/enabled/stop`, param, resParams, )
}
export function start_veri(param = {}, resParams) { //启用
  return request.post(`${commonUrl}/v1/app/vendor/veri/enabled/start`, param, resParams, )
}
export function ins_veri(param = {}, resParams) { //新增
  return request.JSON_Post(`${commonUrl}/v1/app/vendor/veri/ins`, param, resParams, )
}
//优惠卷
export function query_coupon(param = {}, resParams) { //优惠卷列表
  return request.get(`${commonUrl}/v1/app/member/coupon/query`, param, resParams, )
}

//商户端 登录
export function login_vendor(param = {}, resParams) { //登录
  return request.post(`${commonUrl}/v1/app/vendor/veri/login`, param, resParams, )
}
export function captcha_vendor(param = {}, resParams) { //app获取验证码
  return request.post(`${commonUrl}/v1/app/vendor/veri/captcha`, param, resParams, )
}
export function logout_vendor(param = {}, resParams) { //退出
  return request.post(`${commonUrl}/v1/app/vendor/veri/logout`, param, resParams, )
}


//商户端 管理
export function writeOff_vendor(param = {}, resParams) { //核销
  return request.JSON_Post(`${commonUrl}/v1/app/vendor/index/writeOff`, param, resParams, )
}
export function queryWriteOff_vendor(param = {}, resParams) { //核销记录
  return request.post(`${commonUrl}/v1/app/vendor/index/queryWriteOff`, param, resParams, )
}
export function loadOrder_vendor(param = {}, resParams) { //订单详情
  return request.post(`${commonUrl}/v1/app/vendor/index/loadOrder`, param, resParams, )
}
export function getInfo_vendor(param = {}, resParams) { //获取首页基础信息
  return request.post(`${commonUrl}/v1/app/vendor/index/getInfo`, param, resParams, )
}
export function checkOrder_vendor(param = {}, resParams) { //订单核销状态
  return request.post(`${commonUrl}/v1/app/vendor/index/checkOrder`, param, resParams, )
}
export function queryPvOut_vendor(param = {}, resParams) { //积分结算查询
  return request.post(`${commonUrl}/v1/app/vendor/index/queryPvOut`, param, resParams, )
}
export function queryVendorJournalLine_vendor(param = {}, resParams) { //积分流水
  return request.post(`${commonUrl}/v1/app/vendor/index/queryVendorJournalLine`, param, resParams, )
}
export function queryApplyCash_vendor(param = {}, resParams) { //查询提现申请
  return request.post(`${commonUrl}/v1/app/vendor/index/queryApplyCash`, param, resParams, )
}
export function applyCash_vendor(param = {}, resParams) { //提现申请
  return request.post(`${commonUrl}/v1/app/vendor/index/applyCash`, param, resParams, )
}
export function getApplyCash_vendor(param = {}, resParams) { //提现申请详情
  return request.post(`${commonUrl}/v1/app/vendor/index/getApplyCash`, param, resParams, )
}


//登录

export function captcha_member(param = {}, resParams) { //app获取验证码
  return request.post(`${commonUrl}/v1/app/member/info/captcha`, param, resParams, )
}
export function bind_member(param = {}, resParams) { //绑定
  return request.post(`${commonUrl}/v1/app/member/info/bind`, param, resParams, )
}
export function login_member(param = {}, resParams) { //登录
  return request.post(`${commonUrl}/v1/app/ab/member/login`, param, resParams, )
}
export function loginNew_member(param = {}, resParams) { //注册
  return request.post(`${commonUrl}/v1/app/ab/member/loginNew`, param, resParams, )
}
export function get_member(param = {}, resParams) { //获取会员信息
  return request.post(`${commonUrl}/v1/app/member/info/get`, param, resParams, )
}
export function remove_member(param = {}, resParams) { //退出绑定
  return request.post(`${commonUrl}/v1/app/member/info/remove`, param, resParams, )
}
export function getAppid_wx(param = {}, resParams) { //getAppid
  return request.get(`${commonUrl}/v1/wx/getAppid`, param, resParams, )
}
export function getOpenid_wx(param = {}, resParams) { //getOpenid
  return request.get(`${commonUrl}/v1/wx/getOpenid`, param, resParams, )
}

export function jsjdk_wx(param = {}, resParams) { //获取jsjdk需要参数
  return request.post(`${commonUrl}/v1/wx/jsjdk`, param, resParams, )
}
export function updInfo_member(param = {}, resParams) { //更新头像和昵称
  return request.post(`${commonUrl}/v1/app/member/info/updInfo`, param, resParams, )
}
export function addMemeberLog_member(param = {}, resParams) { //添加客流量
  return request.post(`${commonUrl}/v1/app/member/info/addMemeberLog`, param, resParams, )
}

// 个人中心
export function loadPointLine_centre(param = {}, resParams) { //获取积分明细
  return request.post(`${commonUrl}/v1/app/member/centre/loadPointLine`, param, resParams, )
}
export function midea_centre(param = {}, resParams) { //意见反馈
  return request.JSON_Post(`${commonUrl}/v1/app/member/centre/midea`, param, resParams, )
}
export function vendorApply_centre(param = {}, resParams) { //商户入驻登记
  return request.JSON_Post(`${commonUrl}/v1/app/member/centre/vendorApply`, param, resParams, )
}
export function redPack_centre(param = {}, resParams) { //红包列表
  return request.post(`${commonUrl}/v1/app/member/centre/redPack`, param, resParams, )
}
export function revRed_centre(param = {}, resParams) { //领取红包
  return request.post(`${commonUrl}/v1/app/member/centre/revRed`, param, resParams, )
}



// 银行业务

export function queryBookModel_book(param = {}, resParams) { //获取银行业务模块列表
  return request.post(`${commonUrl}/v1/app/member/book/queryBookModel`, param, resParams, )
}
export function doBindBook_book(param = {}, resParams) { //预约办理银行业务(用户已绑定)
  return request.post(`${commonUrl}/v1/app/member/book/doBindBook`, param, resParams, )
}
export function doBook_book(param = {}, resParams) { //预约办理银行业务(用户未绑定)
  return request.post(`${commonUrl}/v1/app/member/book/doBook`, param, resParams, )
}
export function captcha_book(param = {}, resParams) { //发送短信验证码
  return request.post(`${commonUrl}/v1/app/member/book/captcha`, param, resParams, )
}
export function getBookModel_book(param = {}, resParams) { //详情
  return request.post(`${commonUrl}/v1/app/member/book/getBookModel`, param, resParams, )
}
export function genPoster_book(param = {}, resParams) { //生成分享海报
  return request.post(`${commonUrl}/v1/app/member/book/genPoster`, param, resParams, )
}




// 订单
export function listOrder_order(param = {}, resParams) { //列表
  return request.post(`${commonUrl}/v1/app/member/order/listOrder`, param, resParams, )
}
export function evaluate_order(param = {}, resParams) { //评价
  return request.JSON_Post(`${commonUrl}/v1/app/member/order/evaluate`, param, resParams, )
}
export function commitOrder_order(param = {}, resParams) { //提交订单
  return request.JSON_Post(`${commonUrl}/v1/app/member/order/commitOrder`, param, resParams, )
}
export function toPay_order(param = {}, resParams) { //支付
  return request.post(`${commonUrl}/v1/app/member/pay/toPay`, param, resParams, )
}
export function payAfter_order(param = {}, resParams) { //支付成功
  return request.post(`${commonUrl}/v1/app/member/pay/payAfter`, param, resParams, )
}
export function loadOrder_order(param = {}, resParams) { //订单详情
  return request.post(`${commonUrl}/v1/app/member/order/loadOrder`, param, resParams, )
}
export function refund_order(param = {}, resParams) { //申请退款
  return request.JSON_Post(`${commonUrl}/v1/app/member/order/refund`, param, resParams, )
}
export function cancelRefund_order(param = {}, resParams) { //撤销退款
  return request.post(`${commonUrl}/v1/app/member/order/cancelRefund`, param, resParams, )
}
export function delOrder_order(param = {}, resParams) { //删除
  return request.post(`${commonUrl}/v1/app/member/order/delOrder`, param, resParams, )
}
export function pendingOrderCount_order(param = {}, resParams) { //订单待付款、待使用、待评价数量
  return request.post(`${commonUrl}/v1/app/member/order/pendingOrderCount`, param, resParams, )
}


//首页

export function get_index(param = {}, resParams) { //获取移动端首页模块
  return request.post(`${commonUrl}/v1/app/member/index/get`, param, resParams, )
}
export function search_index(param = {}, resParams) { //获取用户搜索历史和热门搜索
  return request.post(`${commonUrl}/v1/app/member/index/search`, param, resParams, )
}
export function clear_index(param = {}, resParams) { //清除个人的搜索记录
  return request.post(`${commonUrl}/v1/app/member/index/search/clear`, param, resParams, )
}
export function getConfig_index(param = {}, resParams) { //获取基础信息配置
  return request.post(`${commonUrl}/v1/app/member/index/getConfig`, param, resParams, )
}


// 商品
export function query_goods(param = {}, resParams) { //分页列表
  return request.post(`${commonUrl}/v1/app/member/goods/query`, param, resParams, )
}
export function getGtype_goods(param = {}, resParams) { //分类列表
  return request.post(`${commonUrl}/v1/app/member/goods/getGtype`, param, resParams, )
}
export function get_goods(param = {}, resParams) { //商品详情
  return request.post(`${commonUrl}/v1/app/member/goods/get`, param, resParams, )
}
export function addCollect_goods(param = {}, resParams) { //添加收藏
  return request.post(`${commonUrl}/v1/app/member/goods/addCollect`, param, resParams, )
}
export function delCollect_goods(param = {}, resParams) { //删除收藏
  return request.post(`${commonUrl}/v1/app/member/goods/delCollect`, param, resParams, )
}
export function collectList_goods(param = {}, resParams) { //收藏列表
  return request.post(`${commonUrl}/v1/app/member/goods/collectList`, param, resParams, )
}
export function queryTj_goods(param = {}, resParams) { //获取推荐商品列表
  return request.post(`${commonUrl}/v1/app/member/goods/queryTj`, param, resParams, )
}
export function queryAppAppraises_goods(param = {}, resParams) { //获取商品评价
  return request.post(`${commonUrl}/v1/app/member/goods/queryAppAppraises`, param, resParams, )
}

// 商户
export function get_vendor(param = {}, resParams) { //详情
  return request.post(`${commonUrl}/v1/app/member/vendor/get`, param, resParams, )
}
export function query_vendor(param = {}, resParams) { //列表
  return request.post(`${commonUrl}/v1/app/member/vendor/query`, param, resParams, )
}
export function queryAppAppraises_vendor(param = {}, resParams) { //商户评价列表
  return request.post(`${commonUrl}/v1/app/member/vendor/queryAppAppraises`, param, resParams, )
}
export function queryGoods_vendor(param = {}, resParams) { //商户商品列表
  return request.post(`${commonUrl}/v1/app/member/vendor/queryGoods`, param, resParams, )
}
export function queryVendor_goods(param = {}, resParams) { //获取商品的适用商户列表
  return request.post(`${commonUrl}/v1/app/member/vendor/queryGoodsVendor`, param, resParams, )
}
export function commitPayOrder_vendor(param = {}, resParams) { //到店支付
  return request.JSON_Post(`${commonUrl}/v1/app/member/pay/order/commitPayOrder`, param, resParams, )
}
export function payCaptcha_vendor(param = {}, resParams) { //到店支付二维码
  return request.post(`${commonUrl}/v1/app/member/pay/order/payCaptcha`, param, resParams, )
}

//分享
export function genPoster_share(param = {}, resParams) { //生成分享海报
  return request.post(`${commonUrl}/v1/app/member/share/genPoster`, param, resParams, )
}
export function query_share(param = {}, resParams) { //我的分销列表
  return request.post(`${commonUrl}/v1/app/member/share/query`, param, resParams, )
}